package com.crm.mapper;

import com.crm.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface userMapper {
    //登录
    @Select("select * from user where tel=#{tel} and password=#{password}")
    User selectByUserAndPwd(User user);
    //注册
    @Insert("insert into user(userName, password, position, description, tel) VALUES (#{userName},#{password},#{position},#{description},#{tel})")
    boolean addOne(User user);
    //根据电话号码查询
    @Select("select * from user where tel=#{tel}")
    User selectByTel(User user);
    @Update("Update user set userName=#{userName},password=#{password},position=#{position}," +
            "description=#{description},tel=#{tel} where uid=#{uid}")
    boolean updateUser(User user);
}
